package me.zhengjie.pojo.entity;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("wcs_inbound_mission_history")
public class WcsInboundMissionHistory {
    @TableId(type = IdType.AUTO)
    @TableField("id")
    private Integer id;

    //入库任务id
    @TableField("inbound_code")
    private String inboundCode;

    //任务状态(0任务创建，1任务发送。2，取货，3放货，4完成)
    @TableField("mission_status")
    private Integer missionStatus;

    //容器编码
    @TableField("container_code")
    private String containerCode;

    //容器类型1,托盘，2料箱
    @TableField("container_type")
    private Integer containerType;

    //起点
    @TableField("source")
    private String source;

    //终点
    @TableField("destination")
    private String destination;

    //agvID
    @TableField("agv_id")
    private String agvId;

    //入库类型（1普通入库，2手工入库，3盘点回库，4，分拣回库，5合箱整理回库）
    @TableField("inbound_type")
    private Integer inboundType;

    //创建时间
    @TableField("create_time")
    private LocalDateTime createTime;

    //更新时间
    @TableField("update_time")
    private LocalDateTime updateTime;

    //优先级
    @TableField("priority")
    private Integer priority;

    //任务类型
    @TableField("task_type")
    private String taskType;

    //是否回库嵌套（默认0,1是嵌套）
    @TableField("is_nest")
    private Integer isNest;

    @TableField("is_plc")
    private Integer isPlc;

    //物料编码
    @TableField("material_code")
    private String materialCode;

    @TableField("wms_task_id")
    private String wmsTaskId;

    public void copy(WcsInboundMissionHistory source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
